cmake_minimum_required(VERSION 2.8)

if ( NOT PROJECT_SOURCE_DIR)
    PROJECT(log4cpp)
    MESSAGE(STATUS "## Making project " ${CMAKE_PROJECT_NAME})
    
    SET(ROOTPATH ${CMAKE_SOURCE_DIR})
    INCLUDE(${ROOTPATH}/cm/global.cmake)
    INCLUDE(${ROOTPATH}/cm/pclint.cmake)
    GET_GPATH (${ROOTPATH})
    SET_USE_FOLDER()
endif()

add_subdirectory(src)

if (EXISTS ${CMAKE_SOURCE_DIR}/modsrc)
    file(GLOB MODSRC_SUB "modsrc/*")
    foreach(sd ${MODSRC_SUB})
        file(RELATIVE_PATH f ${CMAKE_SOURCE_DIR} ${sd})
        message(STATUS "Add modsrc sub directory: ${f}")
        add_subdirectory(${f})
    endforeach()
endif()
